package day15.tcpsocket01;

import java.io.*;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * @author Xiao
 * @date 2021/8/9
 */
public class TCPServer01 {
    public static void main(String[] args) throws IOException {
        ServerSocket ss = new ServerSocket(12312);
        Socket so = ss.accept();
        BufferedReader bw = new BufferedReader(new InputStreamReader(so.getInputStream()));
        String s;
        while ((s = bw.readLine()) != null) {
            System.out.println(s);
        }
        so.close();
        ss.close();
    }
}
